The present invention relates to industrial vision systems using one-dimensional image detectors also known as line scan cameras, and specifically relates to a method and apparatus for imaging using a line scan camera and building a two dimensional image from the data obtained using the line scan camera.
It is known to obtain a two-dimensional image from a line scan camera by providing relative motion between the camera and the object to be imaged. This, for example, is the way such scanners as used in fax machines and photocopiers commonly operate. The object to be imaged is illuminated, e.g., with light, or with an x-ray source, or other source of radiating energy. The collection of lines captured during the relative motion can be used to build a two-dimensional image. Such an arrangement is common, for example, in industrial vision, in which the line-scan camera is stationary, and the article to be imaged moves is in the form of a moving web, or on a moving belt. The arrangement is particularly useful and common for inspecting a continuous ribbon of material such as paper, glass, material, or plastic. Inspecting such a material is known as “web inspection.”
Industrial vision also uses line-scan cameras when very high resolution is needed. Today (2003), it is cheaper to use a 5000-element line-scan camera and a mechanical fixture to provide relative motion, than using a 5000 by 5000 area-scan camera. Such large area image detectors are still relatively expensive.
Constant speed of relative motions and a constant rate at which lines of image data are obtained—called the camera rate herein—lead to an image that is uniformly sampled in each of the two dimensions. The spatial sampling period need not be the same in the two dimensions. Furthermore, when both the speed of relative motion and the camera rate are constant, constant exposure leads to an evenly exposed two-dimensional image.
If the speed of relative motion is not constant, the gap between successive scanned lines is not constant. Such speed variations lead to a geometric distortion unless corrective measures are taken.
Many industrial applications cannot achieve a constant speed of relative motion between the camera and object to be imaged. Large high-speed industrial document scanners, for example, require relatively long acceleration and deceleration phases, but are required to correctly scan sheets of paper at any time.
The present invention is related to dealing with such non-uniform speed variations.
One prior art method of dealing with the speed variation is to control the camera rate according to the speed of relative motion. When the relative motion is slower, the camera rate is also decreased to maintain a constant distance between scan lines. Similarly, when the relative motion is faster, the camera rate is proportionally increased.
A common way of achieving a camera rate proportional to the speed is to use a motion encoder, typically an electromechanical device that provides a pulse train of a rate proportional to speed of linear motion in the case of a linear encoder, or a pulse train of a rate proportional to the revolution rate in the case of a rotary encoder. By the encoder rate we mean the pulse frequency proportional to the speed of relative motion. By the encoder pitch we mean the distance traveled in relative motion between the camera and object to be imaged between consecutive pulses. Note that using an encoder is not the only way to obtain a repeating pulse of a frequency proportional to the speed of relative motion. Another way is by using a stepping motor to move the web, and thus provide the relative motion. Such a stepping motor is driven by a pulse train, such that each consecutive pulse leads to a motion of a known amount, e.g., a known rotation of the motor corresponding to a known relative displacement between the camera and object to be imaged. The term encoder pitch is equally applicable to this and other mechanisms of providing a signal of a frequency proportional to the relative motion.
Thus, one prior art method of accommodating speed variations is to link the camera rate to the encoder rate, e.g., to have the camera rate be a programmable fraction of the encoder rate.
Note that the maximum camera rate a camera can accommodate is determined by the time needed to extract the pixel data out of the camera (the “readout time”). For example, a 2048-pixel camera with a pixel rate of 20 MHz requires 102.4 μs to read out, assuming no additional time overhead. This sets the maximum camera rate at 9.7 kHz. In practice, there is also an unavoidable time overhead, leading to slightly lower maximum camera rate.
Another aspect of using line scan (and other) cameras is exposure. A typical line scan camera has no exposure control. We call such a camera a permanent exposure camera. With such a camera, the time the image is collected is determined by the camera rate. Thus, with uniform illumination, video lines that are scanned at low speed are exposed for longer and are thus brighter than those exposed at low speed. This produces an undesirable variation in amplitude.
Some line scan cameras include an electronic shutter that controls the exposure time. Such cameras are called controlled exposure cameras. These are also sometimes called integration control and shutter control cameras. Typically, with such cameras, the pulse width of an exposure input signal sets the shutter time. The variations of amplitude may be controlled by fixing the time the cameras shutter is open so long as the shutter time is less than the period corresponding to the camera rate.
Thus, one prior art solution to dealing with variable web speed is to use a mechanism such as an encoder or stepping motor that provides an encoder rate proportional to the speed of the web to accommodate speed variations, and to use a controlled exposure camera to ensure uniform exposure.
FIG. 1 shows such a prior-art controlled exposure system. A stationary line-scan camera includes a line trigger input that triggers an exposure and an exposure input that is a periodic pulse at the camera rate with a pulse width that sets the exposure time. The moving web includes an encoder that generates pulses at a rate proportional to the speed of the web. A rate converter controllable by a resolution control module of a controller outputs the line trigger signal at the camera rate proportional to the web speed rate. The exposure input accepts a pulse of a controllable length from a one-shot pulse generator controlled by an exposure control unit. The one-shot pulse generator is triggered by a camera rate input from the rate converter. The outputs from the camera are line-scan data sets accepted by a camera data conditioner and stored in an image storage memory.
It turns out that having exposure control somehow degrades the quality of the output video signal (the line-scan data sets). This may be because there is a rather aggressive charge dumping inside the sensor with exposure control. Whatever the reason, it is widely recognized that this occurs. In the camera community, it is said the exposure control increases what is called the fixed noise pattern.
Furthermore, there recently have been introduced some relatively high-resolution relatively high rate line-scan camera that do not provide for exposure control.
Furthermore, with exposure control, there is a maximum rate beyond which the camera cannot operate, e.g., as determined by the readout time. In the case of the camera rate being proportional to the encoder rate, if the encoder rate exceeds some fixed limit, the camera may signal an exception condition and scanning typically is stopped. More typically, the camera provides no “exception condition signal” but “looses” the overriding trigger pulses. The output is not reliable in such a case.
Furthermore, with exposure control, a substantial amount of the image information may be lost, for example, when the shutter is closed. Thus, for example, when the web is moving relatively slowly, the lines from which a two-dimensional (2-D) image needs to be constructed are further apart. There is therefore a spatial distortion that varies with the relative speed. Furthermore, less of the illumination is collected from those parts of the imaged object that are in between the collected image lines, limiting the signal-to-noise ratio (SNR).
The alternative to exposure control is a free-running camera that generates a line scan at some fixed relatively high camera rate. The rate may be provided by the camera using an internal clock in the camera. Such a camera rate is related to the maximum pixel rate of the line scan detector. Alternately, an external clock may be used to operate the camera without exposure control.
As described above, there are advantages to having no exposure control. As an example, setting a camera rate lower than a maximum value is a mechanism that provides for increasing the exposure time, thus improving the sensitivity, even when no exposure control is explicitly provided within the camera.
Thus, there is a need for a method and apparatus that uses permanent exposure camera and that accommodates variations in relative speed between a camera and an object to be imaged.
Thus there also is a need for a method and apparatus of imaging using a permanent exposure line-scan camera with the camera cycling freely so that imaging occurs a maximum amount of the time.
Thus there also is a need for a method and apparatus of imaging using a permanent exposure line-scan camera with no upper limit to the encoder rate other than that with “too high” an encoder rate, the information may not be processable. Not having such an upper limit provides a margin of safety in the operation, ensuring a reliable use of the maximum rate performance from the camera.